<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>App下载</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            height: 100%;
            background: #fff;
        }
        .down-btns{
            padding-top:5%;
        }
        .main a{
            width:100%;
            text-align: center;
            display: block;
            margin-top:2%;
        }
        .main a img{
            width:50%;
        }
        .other{
            width: 100%;
            height:100%;
            position: fixed;
            top:0;
            bottom:0;
            background: rgba(0,0,0,0.8);
        }
    </style>
</head>
<body>
<div class="main">
    <img src="/index/assets/download/bg.jpg" alt="" style="width:100%;">
    <div class="down-btns">
        <a href="javascript:;">
            <img src="/index/assets/download/iphone.png" class="">
        </a>
        <a href="javascript:;">
            <img src="/index/assets/download/android.png" class="">
        </a>
    </div>

</div>

<div class="other" style="display: none">
    <img src="/index/assets/download/close.png" style="position: absolute;top:5%;left:10%;width:5%;" onclick="$('.other').hide()">
    <img src="/index/assets/download/other.png" style="width:100%;margin-top:5%;">
</div>
</body>
<script src="/js/jquery.js"></script>
<script>

    $(function(){
        if(isWeiXin()) {
            $('.other').show();
        }
    })
    $('.down-btns a').click(function () {

        if(isWeiXin()){
            $('.other').show();
        }else{
            window.location.href="/index/index/downloadApp"
        }

    })
    //判断是否是微信浏览器的函数
    function isWeiXin(){
        //window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息，这个属性可以用来判断浏览器类型
        var ua = window.navigator.userAgent.toLowerCase();
        //通过正则表达式匹配ua中是否含有MicroMessenger字符串
        if(ua.match(/MicroMessenger/i) == 'micromessenger'){
            return true;
        }else{
            return false;
        }
    }
</script>
</html>